package com.community.consumer.service.impl;

import com.community.common.entity.Order;
import com.community.common.entity.OrderMore;
import com.community.consumer.mapper.UserMapper;
import com.community.consumer.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    /**
     * 用户加积分
     * @param order
     */
    @Override
    public void updateById(Order order) {
        // 价格
        Double price= userMapper.findOrderMore(order.getOrderNum(),order.getUserId());
        userMapper.updateById(order,price);
    }
}
